import {RouteObject,createHashRouter} from 'react-router-dom'
import AuthGuard from '../components/AuthGuard'
import Home from '../pages/home'
import Floor from '../pages/home/floor'
import GoodsDetail from '../pages/commonpages/goodsdetail'
import Catetory from '../pages/category'
import { ReactNode } from 'react'
export type RouteType = {
    name?: string,
    id?: string,
    title?: string,
    icon?: string,
    path: string,
    element: ReactNode,
    children?: RouteType[]
}
const routesConfig:RouteType[] = [
    {
        path: '/',
        element: <AuthGuard path='/home'></AuthGuard>
    },
    {
        path: '/home',
        element: <Home/>,
        children: [
            {
                path: '/home/:floorId',
                element: <Floor/>,
                children: [
                    {
                        path: '/home/:floorId/:goodsId',
                        element: <GoodsDetail/>,
                        children: [
                            {
                                path: '/home/:floorId/:goodsId/adddetail',
                                element: <div>加购详情</div>
                            }
                        ]
                    }
                ]
            },
            
        ]

    },
    {
        path: '/category',
        element: <Catetory/>
    },
    {
        path: '/login',
        element: <div>login</div>
    },
    {
        path: '*',
        element: <div>404</div>
    }
]

export {
    routesConfig,
}
